//
//  ModelMainPhone.m
//  LFCWarmSystem
//
//  Created by 李福才 on 16/4/24.
//  Copyright © 2016年 李福才. All rights reserved.
//

#import "ModelMainPhone.h"

@implementation ModelMainPhone
- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeInteger:self._id forKey:@"_id"];
    [aCoder encodeObject:self.phoneNumber forKey:@"phoneNumber"];
    [aCoder encodeObject:self.phoneName forKey:@"phoneName"];
    [aCoder encodeObject:self.language forKey:@"language"];

}

- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    if (self) {
        self._id = [aDecoder decodeIntForKey:@"phoneNumber"];
        self.phoneNumber = [aDecoder decodeObjectForKey:@"phoneNumber"];
        self.phoneName = [aDecoder decodeObjectForKey:@"phoneName"];
        self.language = [aDecoder decodeObjectForKey:@"language"];
    }
    return self;
}


//NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:ACCOUNTARRARY];
//NSMutableArray *accArr = (!data)?[NSMutableArray array]:[NSKeyedUnarchiver unarchiveObjectWithData:data];

//NSData *archiverData = [NSKeyedArchiver archivedDataWithRootObject:accArr];
//[[NSUserDefaults standardUserDefaults] setObject:archiverData forKey:ACCOUNTARRARY];
//[[NSUserDefaults standardUserDefaults] synchronize];
@end
